using System;
using System.ComponentModel.DataAnnotations;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 文章数据传输对象
    /// 用于传输文章相关的数据信息，包括文章内容、分类、SEO设置等
    /// </summary>
    public class ArticleDto
    {
        /// <summary>
        /// 文章ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 文章标题
        /// </summary>
        [Required(ErrorMessage = "文章标题不能为空")]
        [StringLength(255, ErrorMessage = "文章标题长度不能超过255个字符")]
        public string Title { get; set; } = string.Empty;

        /// <summary>
        /// 文章别名/URL slug
        /// </summary>
        [StringLength(255, ErrorMessage = "文章别名长度不能超过255个字符")]
        public string? Slug { get; set; }

        /// <summary>
        /// 文章摘要
        /// </summary>
        [StringLength(500, ErrorMessage = "文章摘要长度不能超过500个字符")]
        public string? Excerpt { get; set; }

        /// <summary>
        /// 文章摘要
        /// </summary>
        [StringLength(500, ErrorMessage = "文章摘要长度不能超过500个字符")]
        public string? Summary { get; set; }

        /// <summary>
        /// 文章内容
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        public long? CategoryId { get; set; }

        /// <summary>
        /// 作者ID
        /// </summary>
        public long? AuthorId { get; set; }

        /// <summary>
        /// 是否已发布
        /// </summary>
        public bool IsPublished { get; set; }

        /// <summary>
        /// 浏览量
        /// </summary>
        public int Views { get; set; }

        /// <summary>
        /// 点赞数
        /// </summary>
        public int Likes { get; set; }

        /// <summary>
        /// 评论数
        /// </summary>
        public int Comments { get; set; }

        /// <summary>
        /// 标签（JSON格式）
        /// </summary>
        public string? Tags { get; set; }

        /// <summary>
        /// 封面图片ID
        /// </summary>
        public long? FeaturedImageId { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? PublishedAt { get; set; }

        /// <summary>
        /// 是否置顶
        /// </summary>
        public bool IsSticky { get; set; }

        /// <summary>
        /// 是否允许评论
        /// </summary>
        public bool AllowComments { get; set; }

        /// <summary>
        /// 评论数量
        /// </summary>
        public int CommentCount { get; set; }

        /// <summary>
        /// 阅读量
        /// </summary>
        public int ViewCount { get; set; }

        /// <summary>
        /// 点赞数
        /// </summary>
        public int LikeCount { get; set; }

        /// <summary>
        /// SEO标题
        /// </summary>
        [StringLength(255, ErrorMessage = "SEO标题长度不能超过255个字符")]
        public string? SeoTitle { get; set; }

        /// <summary>
        /// SEO关键词
        /// </summary>
        [StringLength(500, ErrorMessage = "SEO关键词长度不能超过500个字符")]
        public string? SeoKeywords { get; set; }

        /// <summary>
        /// SEO描述
        /// </summary>
        [StringLength(500, ErrorMessage = "SEO描述长度不能超过500个字符")]
        public string? SeoDescription { get; set; }

        /// <summary>
        /// 自定义属性
        /// </summary>
        public string? CustomFields { get; set; }

        /// <summary>
        /// 排序权重
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public byte Status { get; set; }

        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public long CreatedBy { get; set; }

        /// <summary>
        /// 修改人ID
        /// </summary>
        public long? UpdatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string? CreatorName { get; set; }

        /// <summary>
        /// 修改人姓名
        /// </summary>
        public string? UpdaterName { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string? CategoryName { get; set; }

        /// <summary>
        /// 封面图片URL
        /// </summary>
        public string? FeaturedImageUrl { get; set; }
    }
}
